<?php

namespace App\Http\Validations\Admin;

use Illuminate\Contracts\Validation\Validator;

class BasicSettingValidation {
    public function create() {
        $rules = [
            'exam_paper'=>['required'],
            'templet'=>['required'],
            'exam_times'=>['required'],
            'open_start_at'=>['required'],
            'open_end_at'=>['required','after:open_start_at'],
        ];
        $attributes = [
            'exam_paper'=>'试卷',
            'templet'=>'试卷模版',
            'exam_times'=>'允许考试次数',
            'open_start_at'=>'考试开放开始时间',
            'open_end_at'=>'考试开放结束时间',
        ];
        return ['rules' =>$rules,
            'attributes' => $attributes,
            'messages' => []
        ];
    }

    //验证后添加的钩子函数
    public function customValidate(Validator $validator) {
        //
    }
}
